﻿using System.Windows.Controls;
using System.Windows.Media;
using MVVM_CAD.Model;

namespace MVVM_CAD.Common
{
    public class DrawingCanvas : Canvas
    {
        public VisualCollection VisualCollection { get; set; }

        internal FigureBase this[int index]
        {
            get
            {
                if (index >= 0 && index < VisualCollection.Count)
                {
                    return (FigureBase)VisualCollection[index];
                }

                return null;
            }
        }

        public DrawingCanvas()
        {
            VisualCollection = new VisualCollection(this);
        }
    }
}
